﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<ModuleType>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
<% this.Title = JSC.Portal.Web.App.Resources.Msg.EditModuleType;  %>
<script type="text/javascript">
$(document).ready(function() {
    $("#formulier").validate(
    {
        rules:
        {
            Name: "required",
            AssemblyName: "required",
            ClassName: "required",
            ControllerName: "required",
            ViewName: "required"
        },
        messages:
        {
            Name: "*",
            AssemblyName: "*",
            ClassName: "*",
            ControllerName: "*",
            ViewName: "*"
        }
    });
});

function Delete() {
    if (confirm('<%= JSC.Portal.Web.App.Resources.Msg.AreYouSureYouWantToDeleteThis %>')) {
        window.location = '<%= Url.Action("Delete", new { id = ViewData.Model.Id }) %>';
    }
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="formulier" method="post" action="<%= Url.Action("SaveOrUpdate", new { id = ViewData.Model.Id }) %>">
    <fieldset class="contentfieldset">
        <legend><%= JSC.Portal.Web.App.Resources.Msg.General %></legend>
        <table border="0">
            <% Html.RenderPartial("DescriptiveEntityEditControl"); %>
        </table>
    </fieldset>
    <fieldset class="contentfieldset">
        <legend><%= JSC.Portal.Web.App.Resources.Msg.ModuleType %></legend>
        <table border="0">
            <tr>
                <td class="tdCaption"><%= JSC.Portal.Web.App.Resources.Msg.AssemblyName %></td>
                <td><%= Html.TextBoxFor(model => model.AssemblyName) %></td>
            </tr>
            <tr>
                <td class="tdCaption"><%= JSC.Portal.Web.App.Resources.Msg.ClassName %></td>
                <td><%= Html.TextBoxFor(model => model.ClassName) %></td>
            </tr>
            <tr>
                <td class="tdCaption"><%= JSC.Portal.Web.App.Resources.Msg.ControllerName %></td>
                <td><%= Html.TextBoxFor(model => model.ControllerName) %></td>
            </tr>
            <tr>
                <td class="tdCaption"><%= JSC.Portal.Web.App.Resources.Msg.ViewName %></td>
                <td><%= Html.TextBoxFor(model => model.ViewName) %></td>
            </tr>
        </table>    
    </fieldset>
    <br />
    <div class="button-bar-right">
        <%= Html.LinkButtonRight(JSC.Portal.Web.App.Resources.Msg.Cancel, Url.Action("List"))%>
        <%= Html.SeperatorRight() %>
        <% if (ViewData.Model.CanDelete) { %>
        <%= Html.LinkButtonRight(JSC.Portal.Web.App.Resources.Msg.Delete, "javascript:Delete()")%>
        <% } %>
        <%= Html.SeperatorRight() %>
        <%= Html.SubmitButtonRight(JSC.Portal.Web.App.Resources.Msg.Save)%>
    </div>
</form>
</asp:Content>
